package com.xxx.main;

import com.alibaba.fastjson.JSONObject;
import com.xxx.service.CalcuCenter;

import java.util.LinkedList;
import java.util.List;

/**
 * 计算睡眠
 * Created by rencong on 17/3/20.
 */
public class main {

    public static void main(String args[]){

        //初始化睡眠数据(模拟数据)
        List<JSONObject> data = new LinkedList<JSONObject>();
        for(int i=0;i<5;i++){

            JSONObject obj= new JSONObject();
            obj.put("time",1234567890123L+i);
            obj.put("hearte",60);
            obj.put("breathe",20);
            obj.put("event",3);

            data.add(obj);
        }


        //执行计算
        CalcuCenter calcuCenter = new CalcuCenter();
        JSONObject result = calcuCenter.sleepReport(data);

        //打印结果
        System.out.println(result.toJSONString());


    }

}
